﻿{include file="public/header"}
<title>接单提醒</title>
</head>
<style>
    .layui-layer-page .layui-layer-content{
        overflow: visible !important;
    }
    .layui-layer-setwin{
        display: none;
    }
</style>
<body>

<div class="page-container">
    <div class="mt-20">
        <table class="table table-border table-bordered table-bg table-hover table-sort">
            <thead>
            <tr class="text-c">
                <th width="80">短信模板</th>
                <th style="width: 1%">操作</th>
            </tr>
            </thead>
            <tbody>

            <tr class="text-c">
                <td> <select  style=" width: 100%;border: none" class="message">
                    {volist name='list' id='vo'}
                    <option value="{$vo.message_id}">{$vo.content}</option>
                    {/volist}
                </select>

                <input type="hidden" value="{$li.assignor}" class="assignor">
               </td>
                <td class="td-manage" >
                    <a style="text-decoration:none" class="ml-5 jie"  href="javascript:;" title="发送"><span class="btn btn-success">发送</span></a>
                </td>
            </tr>

            </tbody>
        </table>


    </div>
</div>

{include file="public/footer"}
<script type="text/javascript">
    /**
     * 发送
     */

    $('.jie').click(function () {
        var message_d=$('.message').val();
        var assignor=$('.assignor').val();
        var src="{:Url('index/order/jie')}";
        layer.confirm('确认要发送该短信吗？', function (index) {
            $.ajax({
                type: 'POST',
                url: src,
                dataType: 'json',
                data: {
                    message_d:message_d,
                    assignor:assignor,
                },
                success: function (data) {
                    var res=JSON.parse(data);
                    if(res.code==200){
                        layer.msg(res.msg, {icon: 1, time: 2000}, function () {
                            parent.location.reload()
                        });
                    }else{
                        layer.msg(res.msg,{icon: 5,time:1000});
                    }

                },
                error: function (data) {
                    console.log(data.msg);
                },
            });
        });
    });

</script>
</body>
</html>